package testing;

import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JPanel;

public class Home extends JPanel
{
	private JButton een1, twee2, drie3, vier4, vijf5, zes6, zeven7, acht8, negen9;
	private HomeHandler homeHandler;
	private OverviewPanel overviewPanel;
	
	public Home(OverviewPanel overviewPanel)
	{
		this.overviewPanel = overviewPanel;
		homeHandler = new HomeHandler();
		setLayout(new GridLayout(3, 3));
		een1 = new JButton("Timer");
		twee2 = new JButton("twee");
		drie3 = new JButton("drie");
		vier4 = new JButton("vier");
		vijf5 = new JButton("vijf");
		zes6 = new JButton("zes");
		zeven7 = new JButton("zeven");
		acht8 = new JButton("acht");
		negen9 = new JButton("negen");
		
		een1.addActionListener(homeHandler);
		
		add(een1);
		add(twee2);
		add(drie3);
		add(vier4);
		add(vijf5);
		add(zes6);
		add(zeven7);
		add(acht8);
		add(negen9);
	}
	
	class HomeHandler implements ActionListener
	{
		public void actionPerformed(ActionEvent e)
		{
			if(e.getSource() == een1)
			{
				overviewPanel.Timer();
			}
			if(e.getSource() == twee2)
			{
				overviewPanel.Darkorbit();
			}
		}
	}
}
